"""miao_django URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import path, re_path, include
from django.views.static import serve
from miaoapp.views import *
from miaoapp.user import *  # 用户模块
from miaoapp.grnrefix import *  # 设备模块
from miaoapp.OrderView import *  # 运单模块

urlpatterns = [
    # 定义超链接路由
    re_path('^static/upload/(?P<path>.*)$', serve, {'document_root': '/static/upload/'}),
    path('menu_list/', MenuList.as_view()),  # 侧边栏数据
    path('before_each/', BeforeEach.as_view()),  # 路由拦截

    # 用户路由
    path('send_code/', SendAlysms.as_view()),  # 获取短信验证码接口
    path('send_email_code/', SendEmailCode.as_view()),  # 获取短信验证码接口
    path('power_list/', PowerList.as_view()),  # 获取权限及公司列表
    path('register/', Register.as_view()),  # 注册接口
    path('login/', Login.as_view()),  # 登录接口
    path('user_info/', UserInfo.as_view()),  # 用户信息接口
    path('admin_auditing/', AdminAuditing.as_view()),  # 管理员修改用户权限
    path('update_pwd/', UpdatePwd.as_view()),  # 找回密码
    path('company_info/', CompanyInfo.as_view()),  # 公司信息接口
    path('qi_niu/', QiNiu.as_view()),  # 七牛云上传文件

    # 设备路由
    path('genre_list/', GenreList.as_view()),  # 获取设备
    path('add_fixing/', AddFixing.as_view()),  # 添加货物类型
    path('fixing_name/', FixingName.as_view()),  # 随机获取货物类型名
    path('fixing_info/', FixingInfo.as_view()),  # 随机获取货物类型信息
    path('add_tag/', AddTag.as_view()),  # 添加标签
    path('tag_info/', TagInfo.as_view()),  # 添加标签
    path('fix_info/', FixInfo.as_view()),  # 获取货物类型信息
    path('customer_info/', CustomerInfo.as_view()),  # 客户信息

    # 运单路由
    path('total_order/', TotalOrder.as_view()),  # 统计
    path('order_name/', OrderName.as_view()),  # 随机生成运单号
    path('order_info/', OrderInfo.as_view()),  # 运单信息
    path('order_status/', OrderStatus.as_view()),  # 运单状态
    path('take_order/', TakeOrder.as_view()),  # 收货
    path('order_address/', OrderAddress.as_view()),  # 获取收发货经纬度
    path('add_search_order/', AddSearchOrder.as_view()),  # 查询该路线是否有订单
    path('add_take_order/', AddTakeOrder.as_view()),  # 回传有订单来往的地址
    path('acc_order/', AccOrder.as_view()),  # 回传查询的订单信息
    path('request_temp/', RequestTemp.as_view()),  # 查询订单下的温度
]
